home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 April / Disc 2 / PCU0403CD2.iso / software / apps / files / anfxw32.exe / #setuppath# / anFXApplet.class (.txt) < prev    next >
Encoding:
Java Class File  |  2003-01-27  |  3.9 KB  |  204 lines

  1. import java.applet.Applet;
  2. import java.awt.Color;
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Dimension;
  6. import java.awt.Event;
  7. import java.awt.Font;
  8. import java.awt.Frame;
  9. import java.awt.Graphics;
  10. import java.net.URL;
  11.  
  12. public class anFXApplet extends Applet implements Runnable {
  13.    // $FF: renamed from: AP boolean
  14.    protected boolean field_0 = true;
  15.    // $FF: renamed from: DM java.awt.Color
  16.    public Color field_1;
  17.    // $FF: renamed from: Ey java.awt.Color
  18.    protected Color field_2;
  19.    // $FF: renamed from: FO short
  20.    public short field_3;
  21.    // $FF: renamed from: EF short
  22.    public short field_4;
  23.    // $FF: renamed from: Jl boolean
  24.    protected static boolean field_5;
  25.    // $FF: renamed from: CJ int
  26.    protected int field_6;
  27.    // $FF: renamed from: Jh java.awt.Frame
  28.    public Frame field_7;
  29.    // $FF: renamed from: DN boolean
  30.    public boolean field_8;
  31.    // $FF: renamed from: DY int
  32.    protected int field_9;
  33.    // $FF: renamed from: AF boolean
  34.    public boolean field_10;
  35.    // $FF: renamed from: IE AppletService
  36.    AppletService field_11;
  37.  
  38.    public void run() {
  39.       Object var1 = null;
  40.       Object var2 = null;
  41.  
  42.       try {
  43.          System.out.println("loading rest");
  44.          Class var6 = Class.forName("c03");
  45.  
  46.          try {
  47.             System.out.println("done");
  48.             AppletService var7 = (AppletService)var6.newInstance();
  49.             var7.Cx(this);
  50.             var7.init();
  51.             this.field_11 = var7;
  52.             ((Component)this).repaint();
  53.             var7.start();
  54.          } catch (Exception var4) {
  55.             this.method_0(this.field_6, -8);
  56.          }
  57.       } catch (Exception var5) {
  58.          System.out.println("Exception: " + ((Throwable)var5).toString());
  59.          this.method_0(this.field_6, -7);
  60.       }
  61.    }
  62.  
  63.    // $FF: renamed from: BP (int, int) void
  64.    public void method_0(int var1, int var2) {
  65.       if (!this.field_8) {
  66.          this.field_9 = var2;
  67.          this.field_8 = true;
  68.  
  69.          try {
  70.             URL var3 = new URL("http://www.stepahead.com.au/eserver/servlet/eServlet?command=error&en=" + this.field_9 + "&tm=" + var1 * 7 + "&url=" + (field_5 ? "local" : ((Applet)this).getDocumentBase().toString()));
  71.             ((Applet)this).getAppletContext().showDocument(var3, "_blank");
  72.          } catch (Exception var4) {
  73.          }
  74.       }
  75.    }
  76.  
  77.    public void update(Graphics var1) {
  78.       this.paint(var1);
  79.    }
  80.  
  81.    public String getAppletInfo() {
  82.       return "AnFX 4.9.15\n(c) 1996,2002 Step Ahead Software. All rights reserved.\nhttp://stepaheadsoftware.com/anfx.htm";
  83.    }
  84.  
  85.    // $FF: renamed from: EJ () boolean
  86.    public static boolean method_1() {
  87.       return field_5;
  88.    }
  89.  
  90.    public boolean handleEvent(Event var1) {
  91.       return this.field_11 != null ? this.field_11.handleEvent(var1) : false;
  92.    }
  93.  
  94.    public void paint(Graphics var1) {
  95.       if (this.field_11 == null) {
  96.          Font var2 = new Font("Arial", 1, 18);
  97.          var1.setFont(var2);
  98.          var1.setColor(this.field_2);
  99.          if (this.field_8) {
  100.             var1.drawString("Error# " + this.field_9 + ". Opening help in a new window...", 20, 55);
  101.             return;
  102.          }
  103.  
  104.          var1.drawString("please wait...", 20, 55);
  105.          if (this.field_0) {
  106.             this.field_0 = false;
  107.             (new Thread(this)).start();
  108.             return;
  109.          }
  110.       } else {
  111.          this.field_11.paint(var1);
  112.       }
  113.  
  114.    }
  115.  
  116.    public synchronized void destroy() {
  117.       if (this.field_11 != null) {
  118.          this.field_11.destroy();
  119.       }
  120.  
  121.    }
  122.  
  123.    public void stop() {
  124.       if (this.field_11 != null) {
  125.          this.field_11.stop();
  126.       }
  127.  
  128.    }
  129.  
  130.    public synchronized void start() {
  131.       if (this.field_11 != null) {
  132.          this.field_11.start();
  133.       }
  134.  
  135.    }
  136.  
  137.    public void init() {
  138.       System.out.println(this.getAppletInfo());
  139.       if (((Applet)this).getDocumentBase().toString().toLowerCase().startsWith("http")) {
  140.          field_5 = false;
  141.       } else {
  142.          field_5 = true;
  143.          System.out.println("Local Mode");
  144.       }
  145.  
  146.       if (((Applet)this).getParameter("gold") != null) {
  147.          this.field_6 = 500000;
  148.       }
  149.  
  150.       if (((Applet)this).getParameter("silver") != null) {
  151.          this.field_6 = 500000;
  152.       }
  153.  
  154.       String var1 = ((Applet)this).getParameter("bgcolor");
  155.       int var2 = 16777215;
  156.  
  157.       try {
  158.          var2 = Integer.parseInt(var1, 16);
  159.          String var3 = System.getProperty("java.version");
  160.          if (var3.startsWith("1.0")) {
  161.             this.method_0(this.field_6, -101);
  162.          } else if (!var3.startsWith("1.1")) {
  163.             this.field_10 = true;
  164.          }
  165.  
  166.          System.out.println("Java " + var3);
  167.       } catch (Exception var6) {
  168.       }
  169.  
  170.       this.field_1 = new Color(var2);
  171.       if (this.field_6 == 500000) {
  172.          ((Component)this).setBackground(this.field_1);
  173.       }
  174.  
  175.       var1 = ((Applet)this).getParameter("fgcolor");
  176.       var2 = 255;
  177.  
  178.       try {
  179.          var2 = Integer.parseInt(var1, 16);
  180.       } catch (Exception var5) {
  181.       }
  182.  
  183.       this.field_2 = new Color(var2);
  184.       Dimension var9 = ((Component)this).size();
  185.       this.field_3 = (short)var9.width;
  186.       this.field_4 = (short)var9.height;
  187.  
  188.       Container var4;
  189.       for(var4 = ((Component)this).getParent(); !(var4 instanceof Frame); var4 = ((Component)var4).getParent()) {
  190.       }
  191.  
  192.       this.field_7 = (Frame)var4;
  193.    }
  194.  
  195.    public anFXApplet() {
  196.       this.field_1 = Color.white;
  197.       this.field_2 = Color.blue;
  198.       this.field_3 = 500;
  199.       this.field_4 = 200;
  200.       this.field_8 = false;
  201.       this.field_10 = false;
  202.    }
  203. }
  204.